package com.medical.controller;

import com.medical.service.FileOssService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/oss")
public class OssUploadController {
    @Autowired
    private FileOssService fileOssService;
/**
 *文件上传接口
 * @author Jerry.xu
 * @date 2024/11/21
 */
    @PostMapping("/upload")
    public String upload(@RequestPart("file") MultipartFile file){
        return fileOssService.uploadToOss(file);
    }



}
